package com.dengqi.mymodule.activity.glide.activity;

import android.os.Bundle;

import com.dengqi.mymodule.BaseActivity;
import com.dengqi.mymodule.R;
import com.dengqi.mymodule.activity.glide.adapter.ViewPagerAdatper;

import java.util.ArrayList;
import java.util.List;

import androidx.viewpager.widget.ViewPager;

/**
 * 图片下限
 * glide 格莱德
 * guide 盖德
 * gradle 格瑞德
 * Created by dell on 2018/6/20
 */
public class GlideViewPagerActivity extends BaseActivity {

    ViewPager viewPager;
    ViewPagerAdatper adatper;
    String url = "http://t1.mmonly.cc/uploads/tu/sm/201602/19/%s.jpg";
    List<String> strs;
    int count = 100;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_glide_viewpager);
        initData();

        viewPager = findViewById(R.id.viewPager);
        adatper = new ViewPagerAdatper(this, strs);
        viewPager.setAdapter(adatper);

    }

    private void initData() {
        strs = new ArrayList<>();
        for(int i=0;i<count;i++){
            strs.add(String.format(url, i+1));
        }

    }

}
